<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 创建symbol
        let s1 = Symbol();
        console.log(s1, typeof s1);

        let s2 = Symbol('JavaScript');
        let s3 = Symbol('JavaScript');
        console.log(s2 === s3);

        // Symbol.for创建
        let s4 = Symbol.for('Java');
        let s5 = Symbol.for('Java');
        console.log(s4 === s5);

        // 不能与其他数据进行运算
        // let result = s1 + 100; // Uncaught TypeError: Cannot convert a Symbol value to a number
        // let result = s1 + s2;

    </script>
</body>
</html>